package dfbz.homework1;

public class Test19 {
    public static void main(String[] args) {
        int[] arr={99,100,98,97,96};
        pingfen(arr);
    }
    public static void pingfen(int[] arr){
        int max=0;
        int min=0;
        int sum=0;
        for (int i=0;i<arr.length;i++) {
            if(arr[i]>max){
                max=arr[i];
            }
            if(i==0){
                min=arr[i];
            }else if(min>arr[i]){
                min=arr[i];
            }
            sum+=arr[i];
        }

        int avg=(sum-max-min)/3;

        System.out.println("最终评分:"+avg);
    }

}
